<template>
    <div>
        <div id="slider" class="mui-slider">
            <div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
                <div class="mui-scroll mystyle">
                    <a v-for="item in classifyList" :key="item.id" :class="['mui-control-item', item.id == 0 ? 'mui-active' : '']">
                        {{item.title}}
                    </a>
                </div>
            </div>
        </div>
        <h1>工程师不想开发了</h1>
    </div>    
</template>

<script>
import mui from '../../lib/mui/js/mui.js'
import {Toast} from 'mint-ui'

export default {
    data() {
        return {
            classifyList: []
        }
    },
    created() {
        this.getPhotoClassify();
    },
    mounted() {
        mui('.mui-scroll-wrapper').scroll({
            deceleration: 0.0005
        });
    },
    methods: {
        getPhotoClassify(){
            this.axios.get('/admin/classify/getClassify/1').then(response => {
                if (response.data.success) {
                    response.data.data.unshift({title: '全部', id: 0});
                    this.classifyList = response.data.data;
                    console.log(this.classifyList);
                } else {
                    Toast("网络错误");
                }
            })
        }
    },
}
</script>

<style lang="scss" scoped>
* {
    touch-action: pan-y;
}
.mystyle{
    background-color: #ebebeb;
}
</style>